package com.javasea.mq.rabbitmq.ack.sender;

import com.javasea.mq.rabbitmq.ack.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *@ClassName Demo
 *@Description TODO
 *@Author longxiaonan@163.com
 *@Date 2022/3/14 0014 16:32
 */
@RestController
@RequestMapping("/demo")
public class Demo {

    @Autowired
    SimpleSender simpleSender;

    /**
     * http://localhost:8080/demo/test?msg=bbb
     * @param msg
     */
    @GetMapping("/test")
    public void test(String msg){
        User user = new User();
        user.setName(msg);
        simpleSender.sendMessage("confirmTestExchange", null, user);
    }

}
